package com.idlestar.androiddocs.view.activity;

import android.app.Activity;
import android.content.res.Resources;
import android.os.Bundle;
import android.view.View;

import com.idlestar.androiddocs.R;
import com.idlestar.androiddocs.view.widget.PieChart;

public class PieChartActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_pie_chart);

        final PieChart pie = (PieChart) this.findViewById(R.id.Pie);
        final PieChart pie2 = (PieChart) this.findViewById(R.id.Pie2);
        pie.addItem("红", 1, 0xffF36C60);
        pie.addItem("绿", 2, 0xff1DE9B6);
        pie.addItem("蓝", 3, 0xff4FC3F7);

        pie2.addItem("红", 1, 0xffF36C60);
        pie2.addItem("绿", 2, 0xff1DE9B6);
        pie2.addItem("蓝", 3, 0xff4FC3F7);

        findViewById(R.id.Reset).setOnClickListener(new View.OnClickListener() {
            public void onClick(View view) {
                pie.setCurrentItem(0);
                pie2.setCurrentItem(0);
            }
        });
    }
}
